/*
 * Copyright (c) 2007 Compl Yue Still, All Rights Reserved.
 */

package hbi.wire.as3.host
{
	import flash.utils.*;
	import hbi.as3.Long;

	public class UTCDate implements DataTag
	{
		
		private var _value:*;
		
		public function get tagValue():*
		{
			return _value;
		}
		
		public function reset():void
		{
			_value = undefined;
		}
		
		public function processIncomingData(input:IDataInput):Boolean
		{
			if(input.bytesAvailable < 8) return false;
			var time:Long = Long.readFrom(input);
			var date:Date = new Date();
			date.setTime(time.valueOf());
			_value = date;
			return true;
		}
		
	}
}
